<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <h:head>             <meta http-equiv="expires" content="0"></meta>             <meta http-equiv="Cache-Control" content="no-cache"></meta>             <meta http-equiv="Cache-Control" content="no-cache"></meta>
        <title>.:DMES:. - Parte de Máquinas</title>
        <link rel="stylesheet" type="text/css" href="#{request.contextPath}/css/webStyle.css"/>
        <script type="text/javascript">
            function start() {
                PF('statusDialog').show();
            }

            function stop() {
                PF('statusDialog').hide();
            }
            
            window.setTimeout("machinePartInit()",1000);
        </script>
    </h:head>
    <h:body style="background-color: #000;">
        <p:ajaxStatus onstart="PF('statusDialog').show()" oncomplete="PF('statusDialog').hide()"/>
        <p:dialog modal="true" widgetVar="statusDialog" header="Cargando..." position="center top"
                  draggable="false" closable="false" resizable="false">
            <p:graphicImage value="/images/loadBar.gif"/>
        </p:dialog>
        <div>

            <!--         Dialogo para guardar nuevos Parte de Máquinas         -->
            
           
            
            <p:dialog id="dialogPartMachineSave" widgetVar="dialogPartMachineSave" draggable="true" 
                      closable="true"  header="Crear Partes de Máquinas" position="center top" width="800"
                      hideEffect="explode" modal="true" showEffect="explode" resizable="true">

                <h:form id="formWizardSave" >

                    <p:wizard  flowListener="#{scMachinePartBean.onFlowProcessSaveMachinePart}" id="wizardSave" widgetVar="wizardSave" 
                               backLabel="Atras" nextLabel="Siguiente">
                        <p:tab title="Datos del Generales" id="tabGeneral" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los datos básicos de la parte de la máquina">
                            <p:panel header="Datos Básicos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  value="Imagen"/>
                                        </td>
                                        <td width="40%" align="left" valign="middle">
                                            <h:graphicImage value="#{scMachinePartBean.searchImage(scMachinePartBean.machinePartSave)}" alt="Imagen no disponible" id="imageSave" 
                                                            width="120" height="120"  />
                                            <p:spacer width="5px"/>
                                            <p:commandButton  id="btnPicture" icon="ui-icon-image"  oncomplete="PF('pictureSave').show()" style="top: -10px;"
                                                              ignoreAutoUpdate="true"/>                                       
                                        </td>
                                        <td colspan="2" ></td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfNameInput" value="Parte de la máquina*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfNameInput"  value="#{scMachinePartBean.machinePartSave.name}"
                                                            />

                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfDescriptionMachine" value="Descripción"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputTextarea    id="tfDescriptionMachine"  
                                                value="#{scMachinePartBean.machinePartSave.description}"
                                                            />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfClasification" value="Clasificación*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu    id="tfClasification"  value="#{scMachinePartBean.machinePartSave.clasification}" 
                                                                >
                                                <f:selectItem itemLabel="..."/>
                                                <f:selectItem itemLabel="Automática" itemValue="Automática"/>
                                                <f:selectItem itemLabel="Eléctrica" itemValue="Eléctrica"/>
                                                <f:selectItem itemLabel="Electromecánica" itemValue="Electromecánica"/>
                                                <f:selectItem itemLabel="Eletrónica" itemValue="Eletrónica"/>
                                                <f:selectItem itemLabel="Manual" itemValue="Manual"/>
                                                <f:selectItem itemLabel="Mecánica" itemValue="Mecánica"/>
                                                <f:selectItem itemLabel="Plc" itemValue="Plc"/>
                                                <f:selectItem itemLabel="Semiautomática" itemValue="Semiautomática"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfValueInput" value="Valor*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfValueInput"  value="#{scMachinePartBean.machinePartSave.value}" 
                                                            style="width: 100px;"/>
                                            <p:spacer width="5"/>
                                            <p:selectOneMenu id="cbMoney"  value="#{scMachinePartBean.machinePartSave.idMoney}" 
                                                             converter="moneyConverter" converterMessage="Error en el tipo de dato de la moneda" style="width: 100px; top: 6px;"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..."/>
                                                <f:selectItems value="#{scMachinePartBean.moneyList}" var="money" itemLabel="#{money.acronym} #{money.description}"/>

                                            </p:selectOneMenu>
                                        </td>
                                    </tr> 
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfMarkInput" value="Marca*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfMarkInput"  value="#{scMachinePartBean.machinePartSave.mark}"
                                                            />
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfSerieInput" value="Serie*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfSerieInput"  value="#{scMachinePartBean.machinePartSave.serie}"
                                                            />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"></td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbSupplier" value="Proveedor*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbSupplier"  value="#{scMachinePartBean.machinePartSave.idSupplierGuarantee}" style="width: 70%;"
                                                             converter="partnerConverter" converterMessage="Error en el tipo de dato del proveedor y garantía"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scMachinePartBean.partnersList}" var="partners" itemLabel="#{partners.companyName}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbCostCenter" value="Centro de Costos*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbCostCenter"  value="#{scMachinePartBean.machinePartSave.idCostCenter}" style="width: 70%;" 
                                                             converter="costCenterConverter" converterMessage="Error en el tipo de dato del centro de costos"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems  value="#{scMachinePartBean.costCenterList}" var="costCenters" itemLabel="#{costCenters.description}"/>
                                            </p:selectOneMenu>
                                            <p:spacer width="5px"/>
                                            <p:commandButton  id="btnAddCostCenter" icon="ui-icon-circle-plus"  oncomplete="PF('centerCostSave').show()" style="top: -8px;"/>
                                            <p:tooltip for="btnAddCostCenter" value="Agregue nuevos centros de costos"/>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfMachine" value="Maquina*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="tfMachine"  value="#{scMachinePartBean.machinePartSave.idMachine}" style="width: 70%;"
                                                             converter="machineConverter" converterMessage="Error en el tipo de dato de la máquina"
                                                             effect="puff"
                                                             height="140" >
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scMachinePartBean.machinesList}" var="machines" itemLabel="#{machines.name}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfProirity" value="Prioridad*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="tfProirity"  value="#{scMachinePartBean.machinePartSave.idPriority}" style="width: 70%;"
                                                             converter="priorityConverter" converterMessage="Error en el tipo de dato de la prioridad"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scMachinePartBean.priorityList}" var="priority" itemLabel="#{priority.name}"/>e
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfUsefulLife" value="Vida Útil*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfUsefulLife"  value="#{scMachinePartBean.machinePartSave.usefulLife}"
                                                            style="width: 100px;"/>
                                            <p:spacer width="5"/>
                                            <p:selectOneMenu id="cbTime"  value="#{scMachinePartBean.machinePartSave.idTime}" 
                                                             converter="timeConverter" converterMessage="Error en el tipo de dato del tiempo" style="width: 100px; top: 6px;"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..."/>
                                                <f:selectItems value="#{scMachinePartBean.timeList}" var="time" itemLabel="#{time.acronym}"/>

                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab> 
                        <!--                        finaliza la pestaña para datos generales -->

                        <!--                        inicia la pestaña para el stock y -->
                        <p:tab title="Dimensiones" id="tabDimension" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las dimensiones">
                            <p:panel header="Dimensiones" 
                                     id="pnlDimension">
                                <f:facet name="header">
                                    <p:outputLabel value="Dimensiones" style="text-align: center;"/>
                                </f:facet>
                                <f:facet name="header">
                                    <p:commandButton icon="ui-icon-plus" id="btnAddMeasure" style="float: right;"  
                                                     oncomplete="PF('measureSave').show()">
                                        <p:tooltip for="btnAddMeasure" value="Agregar una medida"/>
                                    </p:commandButton>
                                </f:facet>
                                <table width="98%" cellspacing="10"  >
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfHigh" value="Altura*"/>

                                        </td>
                                        <td width="40%" align="left">

                                            <p:inputText    id="tfHigh"  value="#{scMachinePartBean.machinePartSave.idDimension.hight}"
                                                            requiredMessage="Debe ingresar la altura" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureHigh" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureHigh"  value="#{scMachinePartBean.measureUnitSaveHigh}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scMachinePartBean.showItem(scMachinePartBean.machinePartSave.idDimension.hight, 1)}" >
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scMachinePartBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>


                                        </td> 
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfWidth" value="Ancho*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfWidth"  value="#{scMachinePartBean.machinePartSave.idDimension.width}"
                                                            requiredMessage="Debe ingresar el ancho" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureWidth" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureWidth"  value="#{scMachinePartBean.measureUnitSaveWidth}" style="width: 60px; top: 6px;"
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scMachinePartBean.showItem(scMachinePartBean.machinePartSave.idDimension.width, 2)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scMachinePartBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfLarge" value="Largo*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfLarge"  value="#{scMachinePartBean.machinePartSave.idDimension.large}"
                                                            requiredMessage="Debe ingresar el alto" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureLarge" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureLarge"  value="#{scMachinePartBean.measureUnitSaveLarge}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scMachinePartBean.showItem(scMachinePartBean.machinePartSave.idDimension.large, 3)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scMachinePartBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfVolume" value="Volumen"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfVolume"  value="#{scMachinePartBean.machinePartSave.idDimension.volume}"
                                                            requiredMessage="Debe ingresar el volumen" style="width: 100px; ">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureVolume" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureVolume"  value="#{scMachinePartBean.measureUnitSaveVolume}" style="width: 60px; top: 6px; " 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scMachinePartBean.showItem(scMachinePartBean.machinePartSave.idDimension.volume, 4)}"> 
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scMachinePartBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfThickness" value="Grosor"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfThickness"  value="#{scMachinePartBean.machinePartSave.idDimension.thickness}"
                                                            requiredMessage="Debe ingresar el grosor" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureThickness" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureThickness"  value="#{scMachinePartBean.measureUnitSaveThickness}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scMachinePartBean.showItem(scMachinePartBean.machinePartSave.idDimension.thickness, 5)}"> 
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scMachinePartBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfRadio" value="Radio"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfRadio"  value="#{scMachinePartBean.machinePartSave.idDimension.radio}"
                                                            requiredMessage="Debe ingresar el radio" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureRadio" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureRadio"  value="#{scMachinePartBean.measureUnitSaveRadio}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             required="true" requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scMachinePartBean.showItem(scMachinePartBean.machinePartSave.idDimension.radio, 6)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scMachinePartBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfWeight" value="Peso*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfWeight"  value="#{scMachinePartBean.machinePartSave.idDimension.weight}"
                                                            requiredMessage="Debe ingresar el peso" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureWeight" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureWeight"  value="#{scMachinePartBean.measureUnitSaveWeight}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             required="true" requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scMachinePartBean.showItem(scMachinePartBean.machinePartSave.idDimension.weight, 7)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scMachinePartBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfObservationsDimension" value="Observaciones"/>
                                        </td>
                                        <td  width="40%" align="left"> 
                                            <p:inputTextarea   id="tfObservationsDimension"  value="#{scMachinePartBean.machinePartSave.idDimension.observations}"
                                                               style="width: 98%;"     />
                                        </td>
                                    </tr>

                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para stock y dimensiones-->
                        <p:tab title="Especificaciones" id="tabSpecifications" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las especificaciones de la parte de la máquina">
                            <p:panel header="Especificaciones" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTittleSpecification" value="Título"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTittleSpecification" value="#{scMachinePartBean.machinePartAttachedSave.tittle}"/>
                                                        <p:tooltip for="tfTittleSpecification" value="Ingrese el título de la especificacion a Realizar"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfSpecificationSave" value="Especificación"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputTextarea id="tfSpecificationSave" value="#{scMachinePartBean.machinePartAttachedSave.description}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="tfTittleSpecification,tfSpecificationSave,dataTableSpecificationSave"
                                                                             actionListener="#{scMachinePartBean.saveAttached(scMachinePartBean.machinePartAttachedSave, scMachinePartBean.machinePartSave , scMachinePartBean.machineAttachedSave , 'SPECIFICATION')}"/>
                                                        </center>
                                                    </td>
                                                </tr>

                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableSpecificationSave"
                                                         var="specifications" 
                                                         value="#{scMachinePartBean.getAttachedList(scMachinePartBean.machineAttachedSave, 'SPECIFICATION')}"
                                                         rowKey="#{specifications.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{specifications.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableSpecificationSave" title="Eliminar Especificaciones"
                                                                     process="dataTableSpecificationSave" 
                                                                     actionListener="#{scMachinePartBean.deleteAttached(scMachinePartBean.machineAttachedSave, specifications)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{specifications.tittle}">
                                                    <p:outputLabel value="#{specifications.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{specifications.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{specifications.description}">
                                                    <p:outputLabel value="#{specifications.description}" id="outDescription"/>
                                                    <p:tooltip value="#{specifications.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para especificaciones-->
                        <!--                        inicia pestaña para características-->
                        <p:tab title="Características" id="tabFeactures" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las características de la parte de la máquina">
                            <p:panel header="Características" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTittleFeacture" value="Título"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTittleFeacture" value="#{scMachinePartBean.machinePartAttachedSave.tittle}"/>
                                                        <p:tooltip for="tfTittleFeacture" value="Ingrese el título de la característica a Realizar"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfFeactureSave" value="Característica"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputTextarea id="tfFeactureSave" value="#{scMachinePartBean.machinePartAttachedSave.description}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="tfTittleFeacture,tfFeactureSave,dataTableFeactureSave"
                                                                             actionListener="#{scMachinePartBean.saveAttached(scMachinePartBean.machinePartAttachedSave, scMachinePartBean.machinePartSave , scMachinePartBean.machineAttachedSave, 'FEACTURE')}"/>
                                                        </center>
                                                    </td>
                                                </tr>

                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableFeactureSave"
                                                         var="feactures" 
                                                         value="#{scMachinePartBean.getAttachedList(scMachinePartBean.machineAttachedSave, 'FEACTURE')}"
                                                         rowKey="#{feactures.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{feactures.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableFeactureSave" title="Eliminar Características"
                                                                     process="dataTableFeactureSave" 
                                                                     actionListener="#{scMachinePartBean.deleteAttached(scMachinePartBean.machineAttachedSave, feactures)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{feactures.tittle}">
                                                    <p:outputLabel value="#{feactures.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{feactures.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{feactures.description}">
                                                    <p:outputLabel value="#{feactures.description}" id="outDescription"/>
                                                    <p:tooltip value="#{feactures.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para características-->
                        <!--                        inicia pestaña para observaciones-->
                        <p:tab title="Observaciones" id="tabObservations" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las observaciones de la parte de la máquina">
                            <p:panel header="Observaciones" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTittleObservation" value="Título"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTittleObservation" value="#{scMachinePartBean.machinePartAttachedSave.tittle}"/>
                                                        <p:tooltip for="tfTittleObservation" value="Ingrese el título de la observación a Realizar"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfObservationSave" value="Observación"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputTextarea id="tfObservationSave" value="#{scMachinePartBean.machinePartAttachedSave.description}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="tfTittleObservation,tfObservationSave,dataTableObservationSave"
                                                            actionListener="#{scMachinePartBean.saveAttached(scMachinePartBean.machinePartAttachedSave, scMachinePartBean.machinePartSave , scMachinePartBean.machineAttachedSave, 'OBSERVATION')}"/>
                                                        </center>
                                                    </td>
                                                </tr>

                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableObservationSave"
                                                         var="observation" 
                                                         value="#{scMachinePartBean.getAttachedList(scMachinePartBean.machineAttachedSave, 'OBSERVATION')}"
                                                         rowKey="#{observation.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{observation.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableObservationSave" title="Eliminar Observaciones"
                                                                     process="dataTableObservationSave" 
                                                                     actionListener="#{scMachinePartBean.deleteAttached(scMachinePartBean.machineAttachedSave, observation)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{observation.tittle}">
                                                    <p:outputLabel value="#{observation.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{observation.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{observation.description}">
                                                    <p:outputLabel value="#{observation.description}" id="outDescription"/>
                                                    <p:tooltip value="#{observation.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para observaciones-->
                        <!--                        inicia pestaña para documentos-->
                        <p:tab title="Documentos" id="tabDocuments" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los documentos del insumo">
                            <p:panel header="Documentos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableDocumentationSave"
                                                         var="document" 
                                                         value="#{scMachinePartBean.documentsListSave}"
                                                         rowKey="#{document.documentTittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{document.documentTittle}">

                                                <f:facet name="header">
                                                    <p:commandButton icon="ui-icon-plus" id="btnAdd" style="float: right;"  
                                                                     oncomplete="PF('documentSave').show()">
                                                        <p:tooltip for="btnAdd" value="Agregar un Documento"/>
                                                    </p:commandButton>
                                                </f:facet>
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableDocumentationSave" title="Eliminar Documentos"
                                                                     process="@this" 
                                                                     actionListener="#{scMachinePartBean.deleteDocument(document)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{document.documentTittle}">
                                                    <p:outputLabel value="#{document.documentTittle}" id="outTittle"/>
                                                    <p:tooltip value="#{document.documentTittle}" for="outTittle"/>
                                                </p:column>                                                 
                                                <p:column  headerText="Documento" sortBy="#{document.documentName}">
                                                    <p:outputLabel value="#{document.documentName}" id="documentName"/>
                                                    <p:tooltip value="#{document.documentName}" for="documentName"/>
                                                </p:column>
                                                <p:column  headerText="Fecha de Subida" sortBy="#{scMachinePartBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}">
                                                    <p:outputLabel value="#{scMachinePartBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}" id="uploadDate"/>
                                                    <p:tooltip value="#{scMachinePartBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}" for="uploadDate"/>
                                                </p:column>
                                                <p:column  headerText="Subido por" sortBy="#{document.uploadBy}">
                                                    <p:outputLabel value="#{document.uploadBy}" id="uploadBy"/>
                                                    <p:tooltip value="#{document.uploadBy}" for="uploadBy"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para documentos                         -->
                        <!--        inicia la pestaña para confirmar datos de guardar-->
                        <p:tab title="Confirmar datos" id="tabConfirmSave" titleStyleClass="tabTittleSavePerson"
                               titletip="Pestaña para confirmar los datos del insumo a crear">
                            <p:panel header="Crear Insumo" style="text-align: center;">
                                <table width="98%" cellspacing="10" style="text-align: center;">
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfNameInputSave" value="Parte de la máquina"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfNameInputSave"  value="#{scMachinePartBean.machinePartSave.name}"/>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfDescriptionSave" value="Descripción"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfDescriptionSave"  value="#{scMachinePartBean.machinePartSave.description}"
                                                              />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"></td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfValueInputSave" value="Valor"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfValueInputSave"  value="#{scMachinePartBean.machinePartSave.value} #{scMachinePartBean.machinePartSave.idMoney.acronym}"/>
                                        </td>
                                    </tr> 
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfMarkInputSave" value="Marca"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfMarkInputSave"  value="#{scMachinePartBean.machinePartSave.mark}"
                                                              />
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfSerieInputSave" value="Serie"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfSerieInputSave"  value="#{scMachinePartBean.machinePartSave.serie}"
                                                              />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="98%" colspan="2">
                                            <p:commandButton id="btnSaveInput" value="Guardar Parte de Máquina" onsuccess="PF('dialogPartMachineSave').hide()"
                                                             actionListener="#{scMachinePartBean.saveMachinePart()}" update=":formMachinePart:scDataTableMachinePart,:formWizardSave"
                                                             oncomplete="PF('wizardSave').loadStep('tabGeneral', false)"/>
                                            <p:spacer width="30"/>
                                            <p:commandButton id="btnCancelPartner" value="Cancelar" oncomplete="PF('dialogPartMachineSave').hide();PF('wizardSave').loadStep('tabGeneral', false)"
                                                             actionListener="#{scMachinePartBean.cleanMachinePartSave()}" update=":formMachinePart:scDataTableMachinePart,:formWizardSave"/>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>

                        </p:tab>
                        <!--        finaliza la pestaña para confirmar datos de guardar-->
                    </p:wizard>
                </h:form>
                <p:ajax event="close" oncomplete="PF('wizardSave').loadStep('tabGeneral', true)" listener="#{scMachinePartBean.cleanMachinePartSave()}" update=":formMachinePart:scDataTableMachinePart,:formWizardSave"/>
            </p:dialog>
            <!--         finaliza el dialogo para guardar Insumos               -->

            <!--         Dialogo para guardar nuevos Parte de Máquinas         -->
            
           
            
            <p:dialog id="dialogPartMachineUpdate" widgetVar="dialogPartMachineUpdate" draggable="true" 
                      closable="true"  header="Actualizar Partes de Máquinas" position="center top" width="800"
                      hideEffect="explode" modal="true" showEffect="explode" resizable="true">

                <h:form id="formWizardUpdate" >

                    <p:wizard  flowListener="#{scMachinePartBean.onFlowProcessUpdateMachinePart}" id="wizardUpdate" widgetVar="wizardUpdate" 
                               backLabel="Atras" nextLabel="Siguiente">
                        <p:tab title="Datos del Generales" id="tabGeneral" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los datos básicos de la parte de la máquina">
                            <p:panel header="Datos Básicos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  value="Imagen"/>
                                        </td>
                                        <td width="40%" align="left" valign="middle">
                                            <h:graphicImage value="#{scMachinePartBean.searchImage(scMachinePartBean.machinePartSelected)}" alt="Imagen no disponible" id="imageSave" 
                                                            width="120" height="120"  />
                                            <p:spacer width="5px"/>
                                            <p:commandButton  id="btnPicture" icon="ui-icon-image"  oncomplete="PF('pictureUpdate').show()" style="top: -10px;"
                                                              ignoreAutoUpdate="true"/>                                       
                                        </td>
                                        <td colspan="2" ></td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfNameInput" value="Parte de la máquina*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfNameInput"  value="#{scMachinePartBean.machinePartSelected.name}"
                                                            />

                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfDescriptionMachine" value="Descripción"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputTextarea    id="tfDescriptionMachine"  
                                                value="#{scMachinePartBean.machinePartSelected.description}"
                                                            />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfClasification" value="Clasificación*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu    id="tfClasification"  value="#{scMachinePartBean.machinePartSelected.clasification}" 
                                                                >
                                                <f:selectItem itemLabel="..."/>
                                                <f:selectItem itemLabel="Automática" itemValue="Automática"/>
                                                <f:selectItem itemLabel="Eléctrica" itemValue="Eléctrica"/>
                                                <f:selectItem itemLabel="Electromecánica" itemValue="Electromecánica"/>
                                                <f:selectItem itemLabel="Eletrónica" itemValue="Eletrónica"/>
                                                <f:selectItem itemLabel="Manual" itemValue="Manual"/>
                                                <f:selectItem itemLabel="Mecánica" itemValue="Mecánica"/>
                                                <f:selectItem itemLabel="Plc" itemValue="Plc"/>
                                                <f:selectItem itemLabel="Semiautomática" itemValue="Semiautomática"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfValueInput" value="Valor*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfValueInput"  value="#{scMachinePartBean.machinePartSelected.value}" 
                                                            style="width: 100px;"/>
                                            <p:spacer width="5"/>
                                            <p:selectOneMenu id="cbMoney"  value="#{scMachinePartBean.machinePartSelected.idMoney}" 
                                                             converter="moneyConverter" converterMessage="Error en el tipo de dato de la moneda" style="width: 100px; top: 6px;"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..."/>
                                                <f:selectItems value="#{scMachinePartBean.moneyList}" var="money" itemLabel="#{money.acronym} #{money.description}"/>

                                            </p:selectOneMenu>
                                        </td>
                                    </tr> 
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfMarkInput" value="Marca*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfMarkInput"  value="#{scMachinePartBean.machinePartSelected.mark}"
                                                            />
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfSerieInput" value="Serie*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfSerieInput"  value="#{scMachinePartBean.machinePartSelected.serie}"
                                                            />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"></td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbSupplier" value="Proveedor*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbSupplier"  value="#{scMachinePartBean.machinePartSelected.idSupplierGuarantee}" style="width: 70%;"
                                                             converter="partnerConverter" converterMessage="Error en el tipo de dato del proveedor y garantía"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scMachinePartBean.partnersList}" var="partners" itemLabel="#{partners.companyName}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbCostCenter" value="Centro de Costos*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbCostCenter"  value="#{scMachinePartBean.machinePartSelected.idCostCenter}" style="width: 70%;" 
                                                             converter="costCenterConverter" converterMessage="Error en el tipo de dato del centro de costos"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems  value="#{scMachinePartBean.costCenterList}" var="costCenters" itemLabel="#{costCenters.description}"/>
                                            </p:selectOneMenu>
                                            <p:spacer width="5px"/>
                                            <p:commandButton  id="btnAddCostCenter" icon="ui-icon-circle-plus"  oncomplete="PF('centerCostSave').show()" style="top: -8px;"/>
                                            <p:tooltip for="btnAddCostCenter" value="Agregue nuevos centros de costos"/>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfMachine" value="Maquina*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="tfMachine"  value="#{scMachinePartBean.machinePartSelected.idMachine}" style="width: 70%;"
                                                             converter="machineConverter" converterMessage="Error en el tipo de dato de la máquina"
                                                             effect="puff"
                                                             height="140" >
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scMachinePartBean.machinesList}" var="machines" itemLabel="#{machines.name}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfProirity" value="Prioridad*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="tfProirity"  value="#{scMachinePartBean.machinePartSelected.idPriority}" style="width: 70%;"
                                                             converter="priorityConverter" converterMessage="Error en el tipo de dato de la prioridad"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scMachinePartBean.priorityList}" var="priority" itemLabel="#{priority.name}"/>e
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfUsefulLife" value="Vida Útil*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfUsefulLife"  value="#{scMachinePartBean.machinePartSelected.usefulLife}"
                                                            style="width: 100px;"/>
                                            <p:spacer width="5"/>
                                            <p:selectOneMenu id="cbTime"  value="#{scMachinePartBean.machinePartSelected.idTime}" 
                                                             converter="timeConverter" converterMessage="Error en el tipo de dato del tiempo" style="width: 100px; top: 6px;"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..."/>
                                                <f:selectItems value="#{scMachinePartBean.timeList}" var="time" itemLabel="#{time.acronym}"/>

                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab> 
                        <!--                        finaliza la pestaña para datos generales -->

                        <!--                        inicia la pestaña para el stock y -->
                        <p:tab title="Dimensiones" id="tabDimension" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las dimensiones">
                            <p:panel header="Dimensiones" 
                                     id="pnlDimension">
                                <f:facet name="header">
                                    <p:outputLabel value="Dimensiones" style="text-align: center;"/>
                                </f:facet>
                                <f:facet name="header">
                                    <p:commandButton icon="ui-icon-plus" id="btnAddMeasure" style="float: right;"  
                                                     oncomplete="PF('measureSave').show()">
                                        <p:tooltip for="btnAddMeasure" value="Agregar una medida"/>
                                    </p:commandButton>
                                </f:facet>
                                <table width="98%" cellspacing="10"  >
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfHigh" value="Altura*"/>

                                        </td>
                                        <td width="40%" align="left">

                                            <p:inputText    id="tfHigh"  value="#{scMachinePartBean.machinePartSelected.idDimension.hight}"
                                                            requiredMessage="Debe ingresar la altura" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardUpdate:cbMeasureHigh" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureHigh"  value="#{scMachinePartBean.measureUnitSaveHigh}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scMachinePartBean.showItem(scMachinePartBean.machinePartSelected.idDimension.hight, 1)}" >
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scMachinePartBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>


                                        </td> 
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfWidth" value="Ancho*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfWidth"  value="#{scMachinePartBean.machinePartSelected.idDimension.width}"
                                                            requiredMessage="Debe ingresar el ancho" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardUpdate:cbMeasureWidth" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureWidth"  value="#{scMachinePartBean.measureUnitSaveWidth}" style="width: 60px; top: 6px;"
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scMachinePartBean.showItem(scMachinePartBean.machinePartSelected.idDimension.width, 2)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scMachinePartBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfLarge" value="Largo*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfLarge"  value="#{scMachinePartBean.machinePartSelected.idDimension.large}"
                                                            requiredMessage="Debe ingresar el alto" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardUpdate:cbMeasureLarge" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureLarge"  value="#{scMachinePartBean.measureUnitSaveLarge}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scMachinePartBean.showItem(scMachinePartBean.machinePartSelected.idDimension.large, 3)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scMachinePartBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfVolume" value="Volumen"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfVolume"  value="#{scMachinePartBean.machinePartSelected.idDimension.volume}"
                                                            requiredMessage="Debe ingresar el volumen" style="width: 100px; ">
                                                <p:ajax event="keyup" update=":formWizardUpdate:cbMeasureVolume" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureVolume"  value="#{scMachinePartBean.measureUnitSaveVolume}" style="width: 60px; top: 6px; " 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scMachinePartBean.showItem(scMachinePartBean.machinePartSelected.idDimension.volume, 4)}"> 
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scMachinePartBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfThickness" value="Grosor"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfThickness"  value="#{scMachinePartBean.machinePartSelected.idDimension.thickness}"
                                                            requiredMessage="Debe ingresar el grosor" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardUpdate:cbMeasureThickness" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureThickness"  value="#{scMachinePartBean.measureUnitSaveThickness}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scMachinePartBean.showItem(scMachinePartBean.machinePartSelected.idDimension.thickness, 5)}"> 
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scMachinePartBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfRadio" value="Radio"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfRadio"  value="#{scMachinePartBean.machinePartSelected.idDimension.radio}"
                                                            requiredMessage="Debe ingresar el radio" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardUpdate:cbMeasureRadio" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureRadio"  value="#{scMachinePartBean.measureUnitSaveRadio}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             required="true" requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scMachinePartBean.showItem(scMachinePartBean.machinePartSelected.idDimension.radio, 6)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scMachinePartBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfWeight" value="Peso*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfWeight"  value="#{scMachinePartBean.machinePartSelected.idDimension.weight}"
                                                            requiredMessage="Debe ingresar el peso" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardUpdate:cbMeasureWeight" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureWeight"  value="#{scMachinePartBean.measureUnitSaveWeight}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             required="true" requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scMachinePartBean.showItem(scMachinePartBean.machinePartSelected.idDimension.weight, 7)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scMachinePartBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfObservationsDimension" value="Observaciones"/>
                                        </td>
                                        <td  width="40%" align="left"> 
                                            <p:inputTextarea   id="tfObservationsDimension"  value="#{scMachinePartBean.machinePartSelected.idDimension.observations}"
                                                               style="width: 98%;"     />
                                        </td>
                                    </tr>

                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para stock y dimensiones-->
                        <p:tab title="Especificaciones" id="tabSpecifications" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las especificaciones de la parte de la máquina">
                            <p:panel header="Especificaciones" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTittleSpecification" value="Título"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTittleSpecification" value="#{scMachinePartBean.machinePartAttachedSave.tittle}"/>
                                                        <p:tooltip for="tfTittleSpecification" value="Ingrese el título de la especificacion a Realizar"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfSpecificationSave" value="Especificación"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputTextarea id="tfSpecificationSave" value="#{scMachinePartBean.machinePartAttachedSave.description}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="tfTittleSpecification,tfSpecificationSave,dataTableSpecificationUpdate"
                                                                             actionListener="#{scMachinePartBean.saveAttached(scMachinePartBean.machinePartAttachedSave, scMachinePartBean.machinePartSelected, scMachinePartBean.machinePartSelected.scMachinePartAttachedList, 'SPECIFICATION')}"/>
                                                        </center>
                                                    </td>
                                                </tr>

                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableSpecificationUpdate"
                                                         var="specifications" 
                                                         value="#{scMachinePartBean.getAttachedList(scMachinePartBean.machinePartSelected.scMachinePartAttachedList, 'SPECIFICATION')}"
                                                         rowKey="#{specifications.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{specifications.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableSpecificationUpdate" title="Eliminar Especificaciones"
                                                                     process="dataTableSpecificationUpdate" 
                                                                     actionListener="#{scMachinePartBean.deleteAttached(scMachinePartBean.machinePartSelected.scMachinePartAttachedList, specifications)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{specifications.tittle}">
                                                    <p:outputLabel value="#{specifications.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{specifications.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{specifications.description}">
                                                    <p:outputLabel value="#{specifications.description}" id="outDescription"/>
                                                    <p:tooltip value="#{specifications.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para especificaciones-->
                        <!--                        inicia pestaña para características-->
                        <p:tab title="Características" id="tabFeactures" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las características de la parte de la máquina">
                            <p:panel header="Características" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTittleFeacture" value="Título"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTittleFeacture" value="#{scMachinePartBean.machinePartAttachedSave.tittle}"/>
                                                        <p:tooltip for="tfTittleFeacture" value="Ingrese el título de la característica a Realizar"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfFeactureSave" value="Característica"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputTextarea id="tfFeactureSave" value="#{scMachinePartBean.machinePartAttachedSave.description}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="tfTittleFeacture,tfFeactureSave,dataTableFeactureSave"
                                                                             actionListener="#{scMachinePartBean.saveAttached(scMachinePartBean.machinePartAttachedSave, scMachinePartBean.machinePartSelected, scMachinePartBean.machinePartSelected.scMachinePartAttachedList, 'FEACTURE')}"/>
                                                        </center>
                                                    </td>
                                                </tr>

                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableFeactureSave"
                                                         var="feactures" 
                                                         value="#{scMachinePartBean.getAttachedList(scMachinePartBean.machinePartSelected.scMachinePartAttachedList, 'FEACTURE')}"
                                                         rowKey="#{feactures.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{feactures.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableFeactureSave" title="Eliminar Características"
                                                                     process="dataTableFeactureSave" 
                                                                     actionListener="#{scMachinePartBean.deleteAttached(scMachinePartBean.machinePartSelected.scMachinePartAttachedList, feactures)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{feactures.tittle}">
                                                    <p:outputLabel value="#{feactures.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{feactures.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{feactures.description}">
                                                    <p:outputLabel value="#{feactures.description}" id="outDescription"/>
                                                    <p:tooltip value="#{feactures.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para características-->
                        <!--                        inicia pestaña para observaciones-->
                        <p:tab title="Observaciones" id="tabObservations" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las observaciones de la parte de la máquina">
                            <p:panel header="Observaciones" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTittleObservation" value="Título"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTittleObservation" value="#{scMachinePartBean.machinePartAttachedSave.tittle}"/>
                                                        <p:tooltip for="tfTittleObservation" value="Ingrese el título de la observación a Realizar"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfObservationSave" value="Observación"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputTextarea id="tfObservationSave" value="#{scMachinePartBean.machinePartAttachedSave.description}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="tfTittleObservation,tfObservationSave,dataTableObservationSave"
                                                            actionListener="#{scMachinePartBean.saveAttached(scMachinePartBean.machinePartAttachedSave, scMachinePartBean.machinePartSelected, scMachinePartBean.machinePartSelected.scMachinePartAttachedList, 'OBSERVATION')}"/>
                                                        </center>
                                                    </td>
                                                </tr>

                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableObservationSave"
                                                         var="observation" 
                                                         value="#{scMachinePartBean.getAttachedList(scMachinePartBean.machinePartSelected.scMachinePartAttachedList, 'OBSERVATION')}"
                                                         rowKey="#{observation.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{observation.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableObservationSave" title="Eliminar Observaciones"
                                                                     process="dataTableObservationSave" 
                                                                     actionListener="#{scMachinePartBean.deleteAttached(scMachinePartBean.machinePartSelected.scMachinePartAttachedList, observation)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{observation.tittle}">
                                                    <p:outputLabel value="#{observation.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{observation.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{observation.description}">
                                                    <p:outputLabel value="#{observation.description}" id="outDescription"/>
                                                    <p:tooltip value="#{observation.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para observaciones-->
                        <!--                        inicia pestaña para documentos-->
                        <p:tab title="Documentos" id="tabDocuments" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los documentos del insumo">
                            <p:panel header="Documentos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableDocumentationSave"
                                                         var="document" 
                                                         value="#{scMachinePartBean.machinePartSelected.scMachinePartDocument}"
                                                         rowKey="#{document.documentTittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{document.documentTittle}">

                                                <f:facet name="header">
                                                    <p:commandButton icon="ui-icon-plus" id="btnAdd" style="float: right;"  
                                                                     oncomplete="PF('documentUpdate').show()">
                                                        <p:tooltip for="btnAdd" value="Agregar un Documento"/>
                                                    </p:commandButton>
                                                </f:facet>
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableDocumentationSave" title="Eliminar Documentos"
                                                                     process="@this" 
                                                                     actionListener="#{scMachinePartBean.deleteDocumentUpdate(document)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{document.documentTittle}">
                                                    <p:outputLabel value="#{document.documentTittle}" id="outTittle"/>
                                                    <p:tooltip value="#{document.documentTittle}" for="outTittle"/>
                                                </p:column>                                                 
                                                <p:column  headerText="Documento" sortBy="#{document.documentName}">
                                                    <p:outputLabel value="#{document.documentName}" id="documentName"/>
                                                    <p:tooltip value="#{document.documentName}" for="documentName"/>
                                                </p:column>
                                                <p:column  headerText="Fecha de Subida" sortBy="#{scMachinePartBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}">
                                                    <p:outputLabel value="#{scMachinePartBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}" id="uploadDate"/>
                                                    <p:tooltip value="#{scMachinePartBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}" for="uploadDate"/>
                                                </p:column>
                                                <p:column  headerText="Subido por" sortBy="#{document.uploadBy}">
                                                    <p:outputLabel value="#{document.uploadBy}" id="uploadBy"/>
                                                    <p:tooltip value="#{document.uploadBy}" for="uploadBy"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para documentos                         -->
                        <!--        inicia la pestaña para confirmar datos de guardar-->
                        <p:tab title="Confirmar datos" id="tabConfirmSave" titleStyleClass="tabTittleSavePerson"
                               titletip="Pestaña para confirmar los datos del insumo a crear">
                            <p:panel header="Crear Insumo" style="text-align: center;">
                                <table width="98%" cellspacing="10" style="text-align: center;">
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfNameInputSave" value="Parte de la máquina"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfNameInputSave"  value="#{scMachinePartBean.machinePartSelected.name}"/>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfDescriptionSave" value="Descripción"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfDescriptionSave"  value="#{scMachinePartBean.machinePartSelected.description}"
                                                              />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"></td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfValueInputSave" value="Valor"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfValueInputSave"  value="#{scMachinePartBean.machinePartSelected.value} #{scMachinePartBean.machinePartSelected.idMoney.acronym}"/>
                                        </td>
                                    </tr> 
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfMarkInputSave" value="Marca"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfMarkInputSave"  value="#{scMachinePartBean.machinePartSelected.mark}"
                                                              />
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfSerieInputSave" value="Serie"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfSerieInputSave"  value="#{scMachinePartBean.machinePartSelected.serie}"
                                                              />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="98%" colspan="2">
                                            <p:commandButton id="btnSaveInput" value="Guardar Parte de Máquina" onsuccess="PF('dialogPartMachineUpdate').hide()"
                                                             actionListener="#{scMachinePartBean.updateMachinePart()}" update=":formMachinePart:scDataTableMachinePart,:formWizardUpdate"
                                                             oncomplete="PF('wizardUpdate').loadStep('tabGeneral', false)"/>
                                            <p:spacer width="30"/>
                                            <p:commandButton id="btnCancelPartner" value="Cancelar" oncomplete="PF('dialogPartMachineUpdate').hide();PF('wizardUpdate').loadStep('tabGeneral', false)"
                                                             actionListener="#{scMachinePartBean.cleanMachinePartSave()}" update=":formMachinePart:scDataTableMachinePart,:formWizardUpdate"/>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>

                        </p:tab>
                        <!--        finaliza la pestaña para confirmar datos de guardar-->
                    </p:wizard>
                </h:form>
                <p:ajax event="close" oncomplete="PF('wizardUpdate').loadStep('tabGeneral', true)" listener="#{scMachinePartBean.cleanMachinePartSave()}" update=":formMachinePart:scDataTableMachinePart,:formWizardUpdate"/>
            </p:dialog>
            <!--         finaliza el dialogo para actualziar partes de maquina               -->
<!--            inicia el dialogo para ver partews de maquina-->
             <p:dialog id="dialogPartMachineView" widgetVar="dialogPartMachineView" draggable="true" 
                      closable="true"  header="Ver Partes de Máquinas" position="center top" width="800"
                      hideEffect="explode" modal="true" showEffect="explode" resizable="true">

                <h:form id="formWizardView" >

                    <p:tabView cache="true" activeIndex="0" dynamic="true" >
                        <p:tab title="Datos del Generales" id="tabGeneral" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los datos básicos de la parte de la máquina">
                            <p:panel header="Datos Básicos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  value="Imagen"/>
                                        </td>
                                        <td width="40%" align="left" valign="middle">
                                            <h:graphicImage value="#{scMachinePartBean.searchImage(scMachinePartBean.machinePartSelected)}" alt="Imagen no disponible" id="imageSave" 
                                                            width="120" height="120"  />
                                        </td>
                                        <td colspan="2" ></td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfNameInput" value="Parte de la máquina*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfNameInput"  value="#{scMachinePartBean.machinePartSelected.name}"
                                                            readonly="true"            />

                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfDescriptionMachine" value="Descripción"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputTextarea    id="tfDescriptionMachine"  readonly="true"
                                                value="#{scMachinePartBean.machinePartSelected.description}"
                                                            />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfClasification" value="Clasificación*"/>
                                        </td>
                                        <td width="40%" align="left"> 
                                            <p:inputText    id="tfClasification"  value="#{scMachinePartBean.machinePartSelected.clasification}" 
                                                      readonly="true"       />
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfValueInput" value="Valor*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfValueInput"  value="#{scMachinePartBean.machinePartSelected.value}" 
                                                      readonly="true"      style="width: 100px;"/>
                                            <p:spacer width="5"/>
                                            <p:selectOneMenu id="cbMoney"  value="#{scMachinePartBean.machinePartSelected.idMoney}" 
                                                             converter="moneyConverter" converterMessage="Error en el tipo de dato de la moneda" style="width: 100px; top: 6px;"
                                                             effect="puff" disabled="true"
                                                             height="140">
                                                <f:selectItem itemLabel="..."/>
                                                <f:selectItems value="#{scMachinePartBean.moneyList}" var="money" itemLabel="#{money.acronym} #{money.description}"/>

                                            </p:selectOneMenu>
                                        </td>
                                    </tr> 
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfMarkInput" value="Marca*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfMarkInput"  value="#{scMachinePartBean.machinePartSelected.mark}"
                                                           readonly="true" />
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfSerieInput" value="Serie*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfSerieInput"  value="#{scMachinePartBean.machinePartSelected.serie}"
                                                           readonly="true" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"></td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbSupplier" value="Proveedor*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbSupplier"  value="#{scMachinePartBean.machinePartSelected.idSupplierGuarantee}" style="width: 70%;"
                                                             converter="partnerConverter" converterMessage="Error en el tipo de dato del proveedor y garantía"
                                                             effect="puff" disabled="true"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scMachinePartBean.partnersList}" var="partners" itemLabel="#{partners.companyName}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbCostCenter" value="Centro de Costos*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbCostCenter"  value="#{scMachinePartBean.machinePartSelected.idCostCenter}" style="width: 70%;" 
                                                             converter="costCenterConverter" converterMessage="Error en el tipo de dato del centro de costos"
                                                             effect="puff" disabled="true"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems  value="#{scMachinePartBean.costCenterList}" var="costCenters" itemLabel="#{costCenters.description}"/>
                                            </p:selectOneMenu>
                                            
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfMachine" value="Maquina*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="tfMachine"  value="#{scMachinePartBean.machinePartSelected.idMachine}" style="width: 70%;"
                                                             converter="machineConverter" converterMessage="Error en el tipo de dato de la máquina"
                                                             effect="puff" disabled="true"
                                                             height="140" >
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scMachinePartBean.machinesList}" var="machines" itemLabel="#{machines.name}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfProirity" value="Prioridad*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="tfProirity"  value="#{scMachinePartBean.machinePartSelected.idPriority}" style="width: 70%;"
                                                             converter="priorityConverter" converterMessage="Error en el tipo de dato de la prioridad"
                                                             effect="puff" disabled="true"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scMachinePartBean.priorityList}" var="priority" itemLabel="#{priority.name}"/>e
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfUsefulLife" value="Vida Útil*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfUsefulLife"  value="#{scMachinePartBean.machinePartSelected.usefulLife}"
                                                            readonly="true" style="width: 100px;"/>
                                            <p:spacer width="5"/>
                                            <p:selectOneMenu id="cbTime"  value="#{scMachinePartBean.machinePartSelected.idTime}" 
                                                             converter="timeConverter" converterMessage="Error en el tipo de dato del tiempo" style="width: 100px; top: 6px;"
                                                             effect="puff" disabled="true"
                                                             height="140">
                                                <f:selectItem itemLabel="..."/>
                                                <f:selectItems value="#{scMachinePartBean.timeList}" var="time" itemLabel="#{time.acronym}"/>

                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab> 
                        <!--                        finaliza la pestaña para datos generales -->

                        <!--                        inicia la pestaña para el stock y -->
                        <p:tab title="Dimensiones" id="tabDimension" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las dimensiones">
                            <p:panel header="Dimensiones" 
                                     id="pnlDimension">
                                <f:facet name="header">
                                    <p:outputLabel value="Dimensiones" style="text-align: center;"/>
                                </f:facet>
                                <table width="98%" cellspacing="10"  >
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfHigh" value="Altura*"/>

                                        </td>
                                        <td width="40%" align="left">

                                            <p:inputText    id="tfHigh"  value="#{scMachinePartBean.machinePartSelected.idDimension.hight}" readonly="true"
                                                            requiredMessage="Debe ingresar la altura" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardUpdate:cbMeasureHigh" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureHigh"  value="#{scMachinePartBean.measureUnitSaveHigh}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff" disabled="true"
                                                             height="140"  >
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scMachinePartBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>


                                        </td> 
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfWidth" value="Ancho*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfWidth"  value="#{scMachinePartBean.machinePartSelected.idDimension.width}"
                                                            requiredMessage="Debe ingresar el ancho" style="width: 100px;" readonly="true">
                                                <p:ajax event="keyup" update=":formWizardUpdate:cbMeasureWidth" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureWidth"  value="#{scMachinePartBean.measureUnitSaveWidth}" style="width: 60px; top: 6px;"
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff" disabled="true"
                                                             height="140" >
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scMachinePartBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfLarge" value="Largo*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfLarge"  value="#{scMachinePartBean.machinePartSelected.idDimension.large}"
                                                            requiredMessage="Debe ingresar el alto" style="width: 100px;" readonly="true">
                                                <p:ajax event="keyup" update=":formWizardUpdate:cbMeasureLarge" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureLarge"  value="#{scMachinePartBean.measureUnitSaveLarge}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff" disabled="true"
                                                             height="140" >
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scMachinePartBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfVolume" value="Volumen"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfVolume"  value="#{scMachinePartBean.machinePartSelected.idDimension.volume}"
                                                            requiredMessage="Debe ingresar el volumen" style="width: 100px; " readonly="true">
                                                <p:ajax event="keyup" update=":formWizardUpdate:cbMeasureVolume" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureVolume"  value="#{scMachinePartBean.measureUnitSaveVolume}" style="width: 60px; top: 6px; " 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff" disabled="true"
                                                             height="140" > 
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scMachinePartBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfThickness" value="Grosor"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfThickness"  value="#{scMachinePartBean.machinePartSelected.idDimension.thickness}"
                                                            requiredMessage="Debe ingresar el grosor" style="width: 100px;" readonly="true">
                                                <p:ajax event="keyup" update=":formWizardUpdate:cbMeasureThickness" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureThickness"  value="#{scMachinePartBean.measureUnitSaveThickness}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff" 
                                                             height="140" disabled="true"> 
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scMachinePartBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfRadio" value="Radio"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfRadio"  value="#{scMachinePartBean.machinePartSelected.idDimension.radio}"
                                                            requiredMessage="Debe ingresar el radio" style="width: 100px;" readonly="true">
                                                <p:ajax event="keyup" update=":formWizardUpdate:cbMeasureRadio" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureRadio"  value="#{scMachinePartBean.measureUnitSaveRadio}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             required="true" requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="true">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scMachinePartBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfWeight" value="Peso*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfWeight"  value="#{scMachinePartBean.machinePartSelected.idDimension.weight}"
                                                            requiredMessage="Debe ingresar el peso" style="width: 100px;" readonly="true">
                                                <p:ajax event="keyup" update=":formWizardUpdate:cbMeasureWeight" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureWeight"  value="#{scMachinePartBean.measureUnitSaveWeight}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             required="true" requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="true">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scMachinePartBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfObservationsDimension" value="Observaciones"/>
                                        </td>
                                        <td  width="40%" align="left"> 
                                            <p:inputTextarea   id="tfObservationsDimension"  value="#{scMachinePartBean.machinePartSelected.idDimension.observations}"
                                                               style="width: 98%;"    readonly="true" />
                                        </td>
                                    </tr>

                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para stock y dimensiones-->
                        <p:tab title="Especificaciones" id="tabSpecifications" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las especificaciones de la parte de la máquina">
                            <p:panel header="Especificaciones" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td align="center" valign="top">
                                            <p:dataTable id="dataTableSpecificationUpdate"
                                                         var="specifications" 
                                                         value="#{scMachinePartBean.getAttachedList(scMachinePartBean.machinePartSelected.scMachinePartAttachedList, 'SPECIFICATION')}"
                                                         rowKey="#{specifications.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{specifications.tittle}">
                                                <p:column  headerText="Título" sortBy="#{specifications.tittle}">
                                                    <p:outputLabel value="#{specifications.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{specifications.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{specifications.description}">
                                                    <p:outputLabel value="#{specifications.description}" id="outDescription"/>
                                                    <p:tooltip value="#{specifications.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para especificaciones-->
                        <!--                        inicia pestaña para características-->
                        <p:tab title="Características" id="tabFeactures" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las características de la parte de la máquina">
                            <p:panel header="Características" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td  align="center" valign="top">
                                            <p:dataTable id="dataTableFeactureSave"
                                                         var="feactures" 
                                                         value="#{scMachinePartBean.getAttachedList(scMachinePartBean.machinePartSelected.scMachinePartAttachedList, 'FEACTURE')}"
                                                         rowKey="#{feactures.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{feactures.tittle}">
                                                
                                                <p:column  headerText="Título" sortBy="#{feactures.tittle}">
                                                    <p:outputLabel value="#{feactures.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{feactures.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{feactures.description}">
                                                    <p:outputLabel value="#{feactures.description}" id="outDescription"/>
                                                    <p:tooltip value="#{feactures.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para características-->
                        <!--                        inicia pestaña para observaciones-->
                        <p:tab title="Observaciones" id="tabObservations" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las observaciones de la parte de la máquina">
                            <p:panel header="Observaciones" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        
                                        <td  align="center" valign="top">
                                            <p:dataTable id="dataTableObservationSave"
                                                         var="observation" 
                                                         value="#{scMachinePartBean.getAttachedList(scMachinePartBean.machinePartSelected.scMachinePartAttachedList, 'OBSERVATION')}"
                                                         rowKey="#{observation.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{observation.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableObservationSave" title="Eliminar Observaciones"
                                                                     process="dataTableObservationSave" 
                                                                     actionListener="#{scMachinePartBean.deleteAttached(scMachinePartBean.machinePartSelected.scMachinePartAttachedList, observation)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{observation.tittle}">
                                                    <p:outputLabel value="#{observation.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{observation.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{observation.description}">
                                                    <p:outputLabel value="#{observation.description}" id="outDescription"/>
                                                    <p:tooltip value="#{observation.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para observaciones-->
                        <!--                        inicia pestaña para documentos-->
                        <p:tab title="Documentos" id="tabDocuments" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los documentos del insumo">
                            <p:panel header="Documentos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableDocumentationSave"
                                                         var="document" 
                                                         value="#{scMachinePartBean.machinePartSelected.scMachinePartDocument}"
                                                         rowKey="#{document.documentTittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{document.documentTittle}">

                                                
                                                <p:column  headerText="Título" sortBy="#{document.documentTittle}">
                                                    <p:outputLabel value="#{document.documentTittle}" id="outTittle"/>
                                                    <p:tooltip value="#{document.documentTittle}" for="outTittle"/>
                                                </p:column>                                                 
                                                <p:column  headerText="Documento" sortBy="#{document.documentName}">
                                                    <p:outputLabel value="#{document.documentName}" id="documentName"/>
                                                    <p:tooltip value="#{document.documentName}" for="documentName"/>
                                                </p:column>
                                                <p:column  headerText="Fecha de Subida" sortBy="#{scMachinePartBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}">
                                                    <p:outputLabel value="#{scMachinePartBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}" id="uploadDate"/>
                                                    <p:tooltip value="#{scMachinePartBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}" for="uploadDate"/>
                                                </p:column>
                                                <p:column  headerText="Subido por" sortBy="#{document.uploadBy}">
                                                    <p:outputLabel value="#{document.uploadBy}" id="uploadBy"/>
                                                    <p:tooltip value="#{document.uploadBy}" for="uploadBy"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para documentos                         -->
                        
                    </p:tabView>
                </h:form> 
            </p:dialog>
            <!--         finaliza el dialogo para ver partes de maquina    -->
            
            <!--           dialogo para crear una medida-->
            <p:dialog id="measureSave" widgetVar="measureSave" draggable="true" 
                      closable="true"  header="Agregar una Medida" position="center top" 
                      hideEffect="explode" modal="true" showEffect="explode" 
                      >
                <h:form id="formMeasure">
                    <table width="98%" cellspacing="10" >
                        <tr>
                            <td width="20%" align="right">
                                <p:outputLabel  for="tfAcronym" value="Medida"/>
                            </td>
                            <td width="80%" align="left">
                                <p:inputText    id="tfAcronym"  value="#{scMachinePartBean.measureUnitSave.acronym}"
                                                required="true" requiredMessage="Campo obligatorio debe ingresar la unidad de medida"/>
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" align="right">
                                <p:outputLabel  for="tfTypeMeasure" value="Tipo"/>
                            </td>
                            <td width="80%" align="left">
                                <p:inputText    id="tfTypeMeasure"  value="#{scMachinePartBean.measureUnitSave.type}"
                                                required="true" requiredMessage="Campo obligatorio debe ingresar el tipo de medida"/>
                            </td>
                        </tr>
                        <tr>

                            <td  align="center" colspan="2">
                                <p:commandButton value="Guardar" actionListener="#{scMachinePartBean.addMeasure()}"  
                                                 onsuccess="PF('measureSave').hide()"
                                                 update="@this,tfAcronym,tfTypeMeasure,:formWizardSave:cbMeasureHigh,:formWizardSave:cbMeasureWidth,:formWizardSave:cbMeasureLarge,
                                                 :formWizardSave:cbMeasureVolume,:formWizardSave:cbMeasureThickness,:formWizardSave:cbMeasureRadio,:formWizardSave:cbMeasureWeight
                                                 ,:formWizardUpdate:cbMeasureHigh,:formWizardUpdate:cbMeasureWidth,:formWizardUpdate:cbMeasureLarge,
                                                 :formWizardUpdate:cbMeasureVolume,:formWizardUpdate:cbMeasureThickness,:formWizardUpdate:cbMeasureRadio,
                                                 :formWizardUpdate:cbMeasureWeight"/>
                                <p:spacer width="20"/>

                                <p:commandButton value="Cancelar" actionListener="#{scMachinePartBean.cleanFieldsMeasure()}" 
                                                 oncomplete="PF('measureSave').hide()"
                                                 update="@this,tfAcronym,tfTypeMeasure"/>
                            </td>
                        </tr>
                    </table>
                </h:form>
            </p:dialog>
            <!--         fin  dialogo para crear una medida-->
            
            <!--            Dialogo para subir imagenes width="10%" align="right" -->
            <p:dialog id="pictureSave" widgetVar="pictureSave" draggable="true" 
                      closable="true"  header="Cargar Imagen..." position="center top" 
                      hideEffect="explode" modal="true" showEffect="explode" 
                      >

                <h:form enctype="multipart/form-data" prependId="false">
                    <p:panelGrid columns="2" style="border: 0px solid; text-align: center;">
                        <p:fileUpload label="Imagen de la Parte de la Máquina" value="#{scMachinePartBean.pictureFile}" mode="simple"
                                      >       >        
                        </p:fileUpload>

                        <p:commandButton id="btnLoadDocument" value="Cargar" icon="ui-icon-circle-arrow-s"
                                         actionListener="#{scMachinePartBean.handleFileUpload(1)}" ajax="false" ignoreAutoUpdate="true"/>
                    </p:panelGrid>
                </h:form>
            </p:dialog>
            <!--            finaliza el dialogo para subir imagenes-->
            <!--            Dialogo para actualizar imagenes width="10%" align="right" -->
            <p:dialog id="pictureUpdate" widgetVar="pictureUpdate" draggable="true" 
                      closable="true"  header="Cargar Imagen..." position="center top" 
                      hideEffect="explode" modal="true" showEffect="explode" 
                      >

                <h:form enctype="multipart/form-data" prependId="false">
                    <p:panelGrid columns="2" style="border: 0px solid; text-align: center;">
                        <p:fileUpload label="Imagen de la Parte de la Máquina" value="#{scMachinePartBean.pictureFile}" mode="simple"
                                      >       >        
                        </p:fileUpload>

                        <p:commandButton id="btnLoadDocumentUpdate" value="Cargar" icon="ui-icon-circle-arrow-s"
                                         actionListener="#{scMachinePartBean.handleFileUpload(2)}" ajax="false" ignoreAutoUpdate="true" />
                    </p:panelGrid>
                </h:form>
            </p:dialog>
            <!--            finaliza el dialogo para actualizar imagenes-->
            
            <!--            Dialogo para subir documentos width="10%" align="right" -->
            <p:dialog id="documentSave" widgetVar="documentSave" draggable="true" 
                      closable="true"  header="Cargar Documento..." position="center top" 
                      hideEffect="explode" modal="true" showEffect="explode" 
                      >
                
                <h:form enctype="multipart/form-data" prependId="false">
                    <p:panelGrid columns="2" style="border: 0px solid; text-align: center;">
                        <p:outputLabel for="tfDocument" value="Título del Documento"/>

                        <p:inputText value="#{scMachinePartBean.documentsSave.documentTittle}" id="tfDocument"  required="true"
                                     requiredMessage="Debe ingresar el nombre del documento"/> 

                        <p:fileUpload label="Documento de la Parte de Máquina" value="#{scMachinePartBean.fileSave}" mode="simple"
                                      update=":formWizardSave:dataTableDocumentationSave">  
                        </p:fileUpload>

                        <p:commandButton id="btnLoadFile" value="Cargar" icon="ui-icon-circle-arrow-s" 
                                         actionListener="#{scMachinePartBean.handleDocumentUpload(1)}" ajax="false" 
                                         update=":formWizardSave:dataTableDocumentationSave"/>
                    </p:panelGrid>
                </h:form>
            </p:dialog>
            <!--            finaliza el dialogo para subir documentos-->

            <!--            Dialogo para subir actualizar -->
            <p:dialog id="documentUpdate" widgetVar="documentUpdate" draggable="true" 
                      closable="true"  header="Actualizar Documento..." position="center top" 
                      hideEffect="explode" modal="true" showEffect="explode" 
                      >

                <h:form enctype="multipart/form-data" prependId="false">
                    <p:panelGrid columns="2" style="border: 0px solid; text-align: center;">
                        <p:outputLabel for="tfDocumentUpdate" value="Título del Documento"/>

                        <p:inputText value="#{scMachinePartBean.documentsSave.documentTittle}" id="tfDocumentUpdate" required="true"
                                     requiredMessage="Debe ingresar el nombre del documento"/> 

                        <p:fileUpload label="Documento de la Parte de una Máquina" value="#{scMachinePartBean.fileSave}" mode="simple"
                                      update=":formWizardUpdate:dataTableDocumentationSave">  
                        </p:fileUpload>

                        <p:commandButton id="btnLoadFileUpdate" value="Cargar" icon="ui-icon-circle-arrow-s" 
                                         actionListener="#{scMachinePartBean.handleDocumentUpload(2)}" ajax="false" 
                                         update=":formWizardUpdate:dataTableDocumentationSave"/>
                    </p:panelGrid>
                </h:form>
            </p:dialog>
            <!--            finaliza el dialogo para actualizar documentos-->
            
            
            <!--           dialogo para crear un centro de costos-->
            <p:dialog id="centerCostSave" widgetVar="centerCostSave" draggable="true"  
                      closable="true"  header="Agregar un Centro de Costos" position="center top" 
                      hideEffect="explode" modal="true" showEffect="explode" 
                      >
                <h:form id="formCostCenter">
                    <table width="98%" cellspacing="10" >
                        <tr>
                            <td width="20%" align="right">
                                <p:outputLabel  for="tfAreaCostCenter" value="Nombre del Área"/>
                            </td>
                            <td width="80%" align="left">
                                <p:inputText    id="tfAreaCostCenter"  value="#{scMachinePartBean.costCenterSave.description}"
                                                required="true" requiredMessage="Campo obligatorio debe ingresar el área del centro de costos"/>
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" align="right">
                                <p:outputLabel  for="tfcodigoCostCenter" value="Código"/>
                            </td>
                            <td width="80%" align="left">
                                <p:inputText    id="tfcodigoCostCenter"  value="#{scMachinePartBean.costCenterSave.costCenter}"
                                                required="true" requiredMessage="Campo obligatorio debe ingresar el código del centro de costos"/>
                            </td>
                        </tr>
                        <tr>

                            <td  align="center" colspan="2">
                                <p:commandButton value="Guardar" actionListener="#{scMachinePartBean.addCostCenter()}"  
                                                 onsuccess="PF('centerCostSave').hide()"
                                                 update="@this,tfAreaCostCenter,tfcodigoCostCenter,:formWizardSave:cbCostCenter"/>
                                <p:spacer width="20"/>
<!--,:formWizardUpdate:cbCostCenter-->
                                <p:commandButton value="Cancelar" actionListener="#{scMachinePartBean.cleanFieldsCostCenter()}" 
                                                 oncomplete="PF('centerCostSave').hide()"
                                                 update="@this,tfAreaCostCenter,tfcodigoCostCenter"/>
                            </td>
                        </tr>
                    </table> 
                </h:form>
            </p:dialog>
            <!--         fin  dialogo para crear un centro de costos-->

            
            
            
                
            
            <!--             inicia el dialogo para eliminar registros           -->
            <p:dialog id="dialogPartMachineDelete" widgetVar="dialogPartMachineDelete" position="center top" 
                      closable="true" draggable="true" dynamic="true" header="Eliminar Máquinas"
                      hideEffect="explode" modal="true" showEffect="explode" resizable="false">
                <h:form id="formWizardDelete">
                    <table width="100%" cellspacing="30" style="padding: 0px; margin: 0px;">
                        <tr>
                            <td>
                                <p:outputLabel value="¿Desea eliminar la parte 
                                #{scMachinePartBean.machinePartSelected.name} de 
                                 #{scMachinePartBean.machinePartSelected.idMachine.name}?" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="center">
                                <p:commandButton value="Eliminar" actionListener="#{scMachinePartBean.deleteMachinePart()}"  
                                                 onsuccess="PF('dialogPartMachineDelete').hide()"
                                                 update="@this,:formMachinePart:scDataTableMachinePart"/>
                                <p:spacer width="20"/>

                                <p:commandButton value="Cancelar" oncomplete="PF('dialogPartMachineDelete').hide()"
                                                 update="@this,:formMachinePart:scDataTableMachinePart" />
                            </td>
                        </tr>
                    </table>
                </h:form>

            </p:dialog>
            <p:growl autoUpdate="true" showDetail="true" life="8000" />
            <!--            finaliza el dialogo para eliminar registros            -->
<!--        #######################################################################-->
            <h:form id="formMachinePart">
                
                <p:remoteCommand name="machinePartInit" update=":formMachinePart:scDataTableMachinePart" />
                <p:dataTable id="scDataTableMachinePart" draggableColumns="true" emptyMessage="No existe información para visualizar" 
                             value="#{scMachinePartBean.machinePartList}" var="machinePart"
                             paginator="true" rows="10"  
                             pageLinks="40"
                             paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                             {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                             rowKey="#{machinePart.idMachinePart}"
                             resizableColumns="true" 
                             liveResize="true" rowsPerPageTemplate="10,20,30" 
                             selectionMode="single" paginatorPosition="top" selection="#{scMachinePartBean.machinePartSelected}"
                             sortBy="#{machinePart.idMachinePart}"
                             >
                    <f:facet name="header">
                        <p:commandButton icon="ui-icon-plus" id="btnAdd" style="float: right;"  
                                         oncomplete="PF('dialogPartMachineSave').show()">
                            <p:tooltip for="btnAdd" value="Agregar un Parte de Máquina"/>
                        </p:commandButton>
                    </f:facet>
                    
                    <p:column filterMatchMode="contains"  filterBy="#{machinePart.idMachine.name}" id="columnMachine" headerText="Máquina" sortBy="#{machinePart.idMachine.name}">    
                        <center>
                            <p:outputLabel value="#{machinePart.idMachine.name}" id="lblMachine"/>
                            <p:tooltip for="lblMachine" value="#{machinePart.idMachine.name}"/>
                        </center>
                    </p:column>
                    <p:column filterMatchMode="contains"  filterBy="#{machinePart.name}" headerText="Parte de la máquina" sortBy="#{machinePart.name}" id="columnMachinePartName">    
                        <center>
                            <p:outputLabel value="#{machinePart.name}" id="lblMachinePartName"/>
                            <p:tooltip for="lblMachinePartName" value="#{machinePart.name}"/>
                        </center>
                    </p:column>
                    <p:column filterMatchMode="contains"  filterBy="#{machinePart.mark}" id="columnMark" headerText="Marca" sortBy="#{machinePart.mark}">    
                        <center>
                            <p:outputLabel value="#{machinePart.mark}" id="lblMark"/>
                            <p:tooltip for="lblMark" value="#{machinePart.mark}"/>
                        </center>
                    </p:column>
                   
                    <p:column filterMatchMode="contains"  filterBy="#{machinePart.value} #{machinePart.idMoney.acronym}" id="columnValue" headerText="Valor" sortBy="#{machinePart.value}">    
                        <center>
                            <p:outputLabel value="#{machinePart.value} #{machinePart.idMoney.acronym}" id="lblValue"/>
                            <p:tooltip for="lblValue" value="#{machinePart.value} #{machinePart.idMoney.acronym}"/>
                        </center>
                    </p:column>
                            
                    <p:column headerText="Admin" width="100">
                        <center>
                            <p:commandButton icon="ui-icon-search" id="btnSearch" update=":formWizardView:"
                            actionListener="#{scMachinePartBean.selectedForDelete(machinePart)}"
                            oncomplete="PF('dialogPartMachineView').show()">
                                <p:tooltip for="btnSearch" value="Visualizar una Parte de Máquina"/>
                            </p:commandButton>
                            <p:spacer width="3"/>
                            <p:commandButton icon="ui-icon-pencil" id="btnEdit" actionListener="#{scMachinePartBean.selectedForUpdate(machinePart)}"
                                             oncomplete="PF('dialogPartMachineUpdate').show()" update=":formWizardUpdate"
                                             >
                                <p:tooltip for="btnEdit" value="Editar un Parte de Máquina"/>
                            </p:commandButton>
                            <p:spacer width="3"/>
                            <p:commandButton icon="ui-icon-close" id="btnDelete" oncomplete="PF('dialogPartMachineDelete').show()"
                                             actionListener="#{scMachinePartBean.selectedForDelete(machinePart)}" >
                                <p:tooltip for="btnDelete" value="Eliminar un Parte de Máquina"/>
                            </p:commandButton>
                        </center>
                    </p:column>
                </p:dataTable>
            </h:form>
        </div>
    </h:body>
</html>

